package com.springboot.template.thread.cycle;

public class StateTest {
    public static void main(String[] args) {
        Thread thread = new Thread(()->{
            for (int i = 0; i < 1000_0000; i++) {

            }
        }, "Thread-李四");
        System.out.println("thread = " + thread.getName() + ", state = " + thread.getState());
        thread.start();
        while (thread.isAlive()) {
            System.out.println("thread = " + thread.getName() + ", state = " + thread.getState());
        }
        System.out.println("thread = " + thread.getName() + ", state = " + thread.getState());
    }
}
